namespace DataClasses
{
    using System;

    public class Preferences : ActiveRecord<Preferences>
    {
        /// <summary>
        /// Empty constructor of preferences
        /// </summary>
        public Preferences() { }

        /// <summary>
        /// Simple constructor of preferences
        /// </summary>
        /// <param name="name"></param>
        /// <param name="path"></param>
        public Preferences(string name, string path)
        {
            Id = Guid.NewGuid();
            this.Name = name;
            this.Path = path;
            Save();
        }

        public Preferences(Guid self, string _name, string _path)
        {
            Id = self;
            this.Name = _name;
            this.Path = _path;
        }

        /// <summary>
        /// Name of set
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Path of the file
        /// </summary>
        public string Path { get; set; }

        public override object[] Objparams
        {
            get
            {
                objects = new object[3];
                objects[0] = Id;
                objects[1] = this.Name;
                objects[2] = this.Path;
                return objects;
            }

            set
            {
                objects = value;
                Id = (Guid)objects[0];
                this.Name = (string)objects[1];
                this.Path = (string)objects[2];
            }
        }
    }
}
